package com.ruoyi.video.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.video.mapper.VideoGroupMapper;
import com.ruoyi.video.domain.VideoGroup;
import com.ruoyi.video.service.IVideoGroupService;

/**
 * 分组Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-09
 */
@Service
public class VideoGroupServiceImpl implements IVideoGroupService 
{
    @Autowired
    private VideoGroupMapper videoGroupMapper;

    /**
     * 查询分组
     * 
     * @param id 分组主键
     * @return 分组
     */
    @Override
    public VideoGroup selectVideoGroupById(Long id)
    {
        return videoGroupMapper.selectVideoGroupById(id);
    }

    /**
     * 查询分组列表
     * 
     * @param videoGroup 分组
     * @return 分组
     */
    @Override
    public List<VideoGroup> selectVideoGroupList(VideoGroup videoGroup)
    {
        return videoGroupMapper.selectVideoGroupList(videoGroup);
    }

    /**
     * 新增分组
     * 
     * @param videoGroup 分组
     * @return 结果
     */
    @Override
    public int insertVideoGroup(VideoGroup videoGroup)
    {
        videoGroup.setCreateTime(new Date());
        return videoGroupMapper.insertVideoGroup(videoGroup);
    }

    /**
     * 修改分组
     * 
     * @param videoGroup 分组
     * @return 结果
     */
    @Override
    public int updateVideoGroup(VideoGroup videoGroup)
    {
        videoGroup.setUpdateTime(new Date());
        return videoGroupMapper.updateVideoGroup(videoGroup);
    }

    /**
     * 批量删除分组
     * 
     * @param ids 需要删除的分组主键
     * @return 结果
     */
    @Override
    public int deleteVideoGroupByIds(Long[] ids)
    {
        return videoGroupMapper.deleteVideoGroupByIds(ids);
    }

    /**
     * 删除分组信息
     * 
     * @param id 分组主键
     * @return 结果
     */
    @Override
    public int deleteVideoGroupById(Long id)
    {
        return videoGroupMapper.deleteVideoGroupById(id);
    }
}
